<?php 
/*
 *  This file is part of Urd.
 *
 *  Urd is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *  Urd is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. See the file "COPYING". If it does not
 *  exist, see <http://www.gnu.org/licenses/>.
 *
 * $LastChangedDate: 2008-07-12 15:43:11 +0200 (Sat, 12 Jul 2008) $
 * $Rev: 1291 $
 * $Author: gavinspearhead $
 * $Id: ajax_showtransfers.php 1291 2008-07-12 13:43:11Z gavinspearhead $
 */
define('ORIGINAL_PAGE', $_SERVER['PHP_SELF']);
$__auth = 'silent';

$pathaus = realpath(dirname(__FILE__));

require_once "$pathaus/../functions/ajax_includes.php" ;

$type = $_GET['type'];
$var = $_GET['var'];

// Apparently there's a session variable named $type, which is an array and an element of which is $var, and the value of which is toggled in this function...........................................................


if(!isset($_SESSION['post_hide_status'])) 
    set_down_status();
	
if(!isset($_SESSION['transfer_hide_status'])) 
    set_down_status();

if ($type == 'post') {
    if (isset($_SESSION['post_hide_status'][$var])){
        $_SESSION['post_hide_status'][$var]++;  // we simply swap a bit 1-> 0 and 0 -> 1 :)
        $_SESSION['post_hide_status'][$var] %= 2;  
    } else 
     $_SESSION['post_hide_status'][$var] = 0;
} else {
    if (isset($_SESSION['transfer_hide_status'][$var])){
        $_SESSION['transfer_hide_status'][$var]++;  // we simply swap a bit 1-> 0 and 0 -> 1 :)
        $_SESSION['transfer_hide_status'][$var] %= 2;  
    } else 
        $_SESSION['transfer_hide_status'][$var] = 0;  

}
echo 'OK';
?>
